package com.yoomiito.app.widget.expand

import android.view.View
import android.view.animation.Animation
import android.view.animation.Transformation
import java.time.Duration

/**
 * 伸缩动画
 */
class ExpandAnimation(val view:View,var startHeight:Int,var endHeight:Int) :Animation(){

    override fun applyTransformation(interpolatedTime: Float, t: Transformation?) {
        super.applyTransformation(interpolatedTime, t)
        view.layoutParams.height = (startHeight+(endHeight-startHeight)*interpolatedTime).toInt()
        view.requestLayout()
    }
}